﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using easyList.Entities;

namespace easyList.Tools
{
    class FilterTool
    {

        public static ArchiveObject filterFilename(ArchiveObject archive, string filterFilename)
        {
            ArchiveObject filteredArchive = new ArchiveObject();

            foreach (FileObject currentFile in archive.contentList)
            {

                if (currentFile.filename.ToUpper().Contains(filterFilename.ToUpper()))
                {
                    filteredArchive.addFileObject(currentFile);
                }
            }

            return filteredArchive;
        }

    }
}
